package personal.xjl.plusdemo.mapper;

import org.apache.ibatis.annotations.*;
import personal.xjl.plusdemo.domain.Course;
import personal.xjl.plusdemo.domain.Student;
import personal.xjl.plusdemo.domain.Teacher;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
* @author kgy
* @description 针对表【teacher】的数据库操作Mapper
* @createDate 2024-12-03 11:15:46
* @Entity personal.xjl.plusdemo.domain.Teacher
*/
@Mapper
public interface TeacherMapper extends BaseMapper<Teacher> {
    @Select("select * from teacher where name=#{name} and password=#{password}")
    public List<Student> login(@Param("name") String name, @Param("password") String password);
    @Select("select * from teacher")
    @Results({
            @Result(column = "course_id",property = "course",javaType = Course.class,
            one = @One(select = "personal.xjl.plusdemo.mapper.CourseMapper.selectById"))
    })
    public List<Teacher> selectAll();
}




